const columns = [
  {
    title: "序号",
    dataIndex: "index",
    key: "index",
    customRender: (text, record, index) => `${index + 1}`,
    align: "center",
  },
  {
    title: "货区编号",
    dataIndex: "serialNumber",
    key: "serialNumber",
    align: "center",
  },
  {
    title: "货区名称",
    dataIndex: "name",
    key: "name",
    align: "center",
  },
  {
    title: "备注",
    dataIndex: "remark",
    key: "remark",
    align: "center",
  },
  {
    title: "操作",
    width: 200,
    dataIndex: "action",
    key: "action",
    align: "center",
    scopedSlots: { customRender: "action" },
  },
];

// 主体背景颜色转换
const caseColor = (value) => {
  switch (value) {
    case 0: // 空仓
      return "#2465FF";
    case 1: // 空闲
      return "#22AC38";
    case 2: // 满仓
      return "#EC3838";
    case 3: // 禁止
      return "#D2D2D2";
  }
};

// 主体背景颜色转换
const caseContentBack = (value) => {
  switch (value) {
    case 0: // 空仓
      return "rgba(36, 101, 255, 0.15)";
    case 1: // 空闲
      return "rgba(34, 172, 56, 0.15)";
    case 2: // 满仓
      return "rgba(236, 56, 56, 0.15)";
    case 3: // 禁止
      return "rgba(140, 140, 140, 0.15)";
  }
};
// 头部背景色转换
const caseHeadBack = (value) => {
  switch (value) {
    case 0:
      return "rgba(36, 101, 255, 0.5)";
    case 1:
      return "rgba(34, 172, 56, 0.5)";
    case 2:
      return "rgba(236, 56, 56, 0.5)";
    case 3:
      return "rgba(140, 140, 140, 0.5)";
  }
};

export { caseColor, columns, caseContentBack, caseHeadBack };
